.class public Lcom/instagram/android/widget/a;
.super Landroid/webkit/WebView;
.source "EnhancedWebView.java"


# instance fields
.field private a:Z

.field private final b:Ljava/util/HashSet;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashSet",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private final c:Landroid/support/v4/app/Fragment;

.field private final d:Ljava/lang/Integer;

.field private e:Lcom/instagram/android/widget/d;

.field private f:Landroid/view/View;

.field private g:I


# direct methods
.method public constructor <init>(Landroid/support/v4/app/Fragment;Ljava/lang/Integer;)V
    .locals 2
    .parameter
    .parameter

    .prologue
    .line 67
    invoke-virtual {p1}, Landroid/support/v4/app/Fragment;->j()Landroid/support/v4/app/j;

    move-result-object v0

    invoke-virtual {v0}, Landroid/support/v4/app/j;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-direct {p0, v0}, Landroid/webkit/WebView;-><init>(Landroid/content/Context;)V

    .line 45
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/instagram/android/widget/a;->a:Z

    .line 46
    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    iput-object v0, p0, Lcom/instagram/android/widget/a;->b:Ljava/util/HashSet;

    .line 68
    iput-object p1, p0, Lcom/instagram/android/widget/a;->c:Landroid/support/v4/app/Fragment;

    .line 69
    iput-object p2, p0, Lcom/instagram/android/widget/a;->d:Ljava/lang/Integer;

    .line 70
    new-instance v0, Lcom/instagram/android/widget/c;

    const/4 v1, 0x0

    invoke-direct {v0, p0, v1}, Lcom/instagram/android/widget/c;-><init>(Lcom/instagram/android/widget/a;Lcom/instagram/android/widget/b;)V

    invoke-virtual {p0, v0}, Lcom/instagram/android/widget/a;->setWebViewClient(Landroid/webkit/WebViewClient;)V

    .line 71
    const/4 v0, 0x2

    invoke-static {p0, v0}, Landroid/support/v4/view/ai;->b(Landroid/view/View;I)V

    .line 72
    invoke-virtual {p0}, Lcom/instagram/android/widget/a;->getSettings()Landroid/webkit/WebSettings;

    move-result-object v0

    invoke-static {}, Lcom/instagram/android/d/h/a;->a()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/webkit/WebSettings;->setUserAgentString(Ljava/lang/String;)V

    .line 73
    return-void
.end method

.method static synthetic a(Lcom/instagram/android/widget/a;)Ljava/util/HashSet;
    .locals 1
    .parameter

    .prologue
    .line 38
    iget-object v0, p0, Lcom/instagram/android/widget/a;->b:Ljava/util/HashSet;

    return-object v0
.end method

.method private a(Landroid/net/Uri;)V
    .locals 3
    .parameter

    .prologue
    .line 388
    iget-object v0, p0, Lcom/instagram/android/widget/a;->c:Landroid/support/v4/app/Fragment;

    invoke-virtual {v0}, Landroid/support/v4/app/Fragment;->j()Landroid/support/v4/app/j;

    move-result-object v0

    new-instance v1, Landroid/content/Intent;

    const-string v2, "android.intent.action.VIEW"

    invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1, p1}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/support/v4/app/j;->startActivity(Landroid/content/Intent;)V

    .line 389
    return-void
.end method

.method static synthetic a(Lcom/instagram/android/widget/a;Landroid/net/Uri;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 38
    invoke-direct {p0, p1}, Lcom/instagram/android/widget/a;->a(Landroid/net/Uri;)V

    return-void
.end method

.method static synthetic a(Lcom/instagram/android/widget/a;Z)Z
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 38
    iput-boolean p1, p0, Lcom/instagram/android/widget/a;->a:Z

    return p1
.end method

.method static synthetic b(Lcom/instagram/android/widget/a;)Lcom/instagram/android/widget/d;
    .locals 1
    .parameter

    .prologue
    .line 38
    iget-object v0, p0, Lcom/instagram/android/widget/a;->e:Lcom/instagram/android/widget/d;

    return-object v0
.end method

.method static synthetic c(Lcom/instagram/android/widget/a;)Z
    .locals 1
    .parameter

    .prologue
    .line 38
    iget-boolean v0, p0, Lcom/instagram/android/widget/a;->a:Z

    return v0
.end method

.method static synthetic d(Lcom/instagram/android/widget/a;)Ljava/lang/Integer;
    .locals 1
    .parameter

    .prologue
    .line 38
    iget-object v0, p0, Lcom/instagram/android/widget/a;->d:Ljava/lang/Integer;

    return-object v0
.end method

.method private d()V
    .locals 3

    .prologue
    .line 150
    iget-object v0, p0, Lcom/instagram/android/widget/a;->d:Ljava/lang/Integer;

    sget-object v1, Lcom/instagram/android/fragment/en;->b:Ljava/lang/Integer;

    invoke-virtual {v0, v1}, Ljava/lang/Integer;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 151
    invoke-virtual {p0}, Lcom/instagram/android/widget/a;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Landroid/support/v4/a/e;->a(Landroid/content/Context;)Landroid/support/v4/a/e;

    move-result-object v0

    new-instance v1, Landroid/content/Intent;

    const-string v2, "com.instagram.android.fragment.NewsFragment.BROADCAST_INBOX_SHOWN"

    invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, v1}, Landroid/support/v4/a/e;->a(Landroid/content/Intent;)Z

    .line 154
    :cond_0
    return-void
.end method

.method private e()V
    .locals 2

    .prologue
    .line 384
    new-instance v0, Lcom/instagram/android/feed/d/a;

    iget-object v1, p0, Lcom/instagram/android/widget/a;->c:Landroid/support/v4/app/Fragment;

    invoke-virtual {v1}, Landroid/support/v4/app/Fragment;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/instagram/android/feed/d/a;-><init>(Landroid/content/Context;)V

    invoke-virtual {v0}, Lcom/instagram/android/feed/d/a;->a()V

    .line 385
    return-void
.end method

.method static synthetic e(Lcom/instagram/android/widget/a;)V
    .locals 0
    .parameter

    .prologue
    .line 38
    invoke-direct {p0}, Lcom/instagram/android/widget/a;->e()V

    return-void
.end method

.method static synthetic f(Lcom/instagram/android/widget/a;)Landroid/support/v4/app/Fragment;
    .locals 1
    .parameter

    .prologue
    .line 38
    iget-object v0, p0, Lcom/instagram/android/widget/a;->c:Landroid/support/v4/app/Fragment;

    return-object v0
.end method


# virtual methods
.method public a()V
    .locals 1

    .prologue
    .line 80
    const-string v0, "javascript:window.scrollTo(0, 0)"

    invoke-virtual {p0, v0}, Lcom/instagram/android/widget/a;->loadUrl(Ljava/lang/String;)V

    .line 81
    return-void
.end method

.method public b()Z
    .locals 1

    .prologue
    .line 84
    iget-boolean v0, p0, Lcom/instagram/android/widget/a;->a:Z

    return v0
.end method

.method protected c()V
    .locals 2

    .prologue
    .line 105
    iget-object v0, p0, Lcom/instagram/android/widget/a;->f:Landroid/view/View;

    if-eqz v0, :cond_0

    .line 106
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "javascript:document.body.style.marginTop=\""

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget v1, p0, Lcom/instagram/android/widget/a;->g:I

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "px\";"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/instagram/android/widget/a;->loadUrl(Ljava/lang/String;)V

    .line 108
    :cond_0
    return-void
.end method

.method protected onLayout(ZIIII)V
    .locals 2
    .parameter "changed"
    .parameter "l"
    .parameter "t"
    .parameter "r"
    .parameter "b"

    .prologue
    .line 112
    invoke-super/range {p0 .. p5}, Landroid/webkit/WebView;->onLayout(ZIIII)V

    .line 118
    if-eqz p1, :cond_0

    iget-object v0, p0, Lcom/instagram/android/widget/a;->f:Landroid/view/View;

    if-eqz v0, :cond_0

    .line 119
    iget-object v0, p0, Lcom/instagram/android/widget/a;->f:Landroid/view/View;

    invoke-virtual {v0}, Landroid/view/View;->getHeight()I

    move-result v0

    int-to-float v0, v0

    invoke-virtual {p0}, Lcom/instagram/android/widget/a;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    invoke-virtual {v1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v1

    iget v1, v1, Landroid/util/DisplayMetrics;->density:F

    div-float/2addr v0, v1

    float-to-int v0, v0

    add-int/lit8 v0, v0, -0x9

    iput v0, p0, Lcom/instagram/android/widget/a;->g:I

    .line 125
    invoke-virtual {p0}, Lcom/instagram/android/widget/a;->c()V

    .line 127
    :cond_0
    return-void
.end method

.method protected onVisibilityChanged(Landroid/view/View;I)V
    .locals 1
    .parameter "changedView"
    .parameter "visibility"

    .prologue
    .line 139
    invoke-virtual {p0}, Lcom/instagram/android/widget/a;->isShown()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 140
    invoke-direct {p0}, Lcom/instagram/android/widget/a;->d()V

    .line 144
    invoke-virtual {p0}, Lcom/instagram/android/widget/a;->c()V

    .line 146
    :cond_0
    invoke-super {p0, p1, p2}, Landroid/webkit/WebView;->onVisibilityChanged(Landroid/view/View;I)V

    .line 147
    return-void
.end method

.method protected onWindowVisibilityChanged(I)V
    .locals 1
    .parameter "visibility"

    .prologue
    .line 131
    invoke-virtual {p0}, Lcom/instagram/android/widget/a;->isShown()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 132
    invoke-direct {p0}, Lcom/instagram/android/widget/a;->d()V

    .line 134
    :cond_0
    invoke-super {p0, p1}, Landroid/webkit/WebView;->onWindowVisibilityChanged(I)V

    .line 135
    return-void
.end method

.method public setHeaderView(Landroid/view/View;)V
    .locals 1
    .parameter "headerView"

    .prologue
    .line 88
    iget-object v0, p0, Lcom/instagram/android/widget/a;->f:Landroid/view/View;

    if-ne p1, v0, :cond_0

    .line 99
    :goto_0
    return-void

    .line 92
    :cond_0
    iget-object v0, p0, Lcom/instagram/android/widget/a;->f:Landroid/view/View;

    if-eqz v0, :cond_1

    .line 93
    iget-object v0, p0, Lcom/instagram/android/widget/a;->f:Landroid/view/View;

    invoke-virtual {p0, v0}, Lcom/instagram/android/widget/a;->removeView(Landroid/view/View;)V

    .line 95
    :cond_1
    if-eqz p1, :cond_2

    .line 96
    invoke-virtual {p0, p1}, Lcom/instagram/android/widget/a;->addView(Landroid/view/View;)V

    .line 98
    :cond_2
    iput-object p1, p0, Lcom/instagram/android/widget/a;->f:Landroid/view/View;

    goto :goto_0
.end method

.method public setOnLoadingChangeListener(Lcom/instagram/android/widget/d;)V
    .locals 0
    .parameter "onLoadingChangeListener"

    .prologue
    .line 76
    iput-object p1, p0, Lcom/instagram/android/widget/a;->e:Lcom/instagram/android/widget/d;

    .line 77
    return-void
.end method
